package generator;

import org.eclipse.uml2.uml.Element;
import java.util.Properties;

public class JpaEntityAssociationsTemplateClass extends BaseTemplateClass {

	protected JpaEntityAssociationsManyToOneTemplateClass jpaEntityAssociationsManyToOneTemplateClass;
	protected JpaEntityAssociationsOneToManyTemplateClass jpaEntityAssociationsOneToManyTemplateClass;

	public JpaEntityAssociationsTemplateClass(Properties properties) {
		super(properties);
		jpaEntityAssociationsManyToOneTemplateClass = new JpaEntityAssociationsManyToOneTemplateClass(properties);
		jpaEntityAssociationsOneToManyTemplateClass = new JpaEntityAssociationsOneToManyTemplateClass(properties);
	}

	public boolean isProcessable() {
		return true;
	}

	public void setElement(Element ele) {
		this.element = ele;
		returningString = new StringBuilder();
		jpaEntityAssociationsManyToOneTemplateClass.setElement(ele);
		jpaEntityAssociationsOneToManyTemplateClass.setElement(ele);
	}

	protected String _returning() {
		returningString.append("\n\t");
		if (jpaEntityAssociationsManyToOneTemplateClass.isProcessable()) {
			returningString.append(jpaEntityAssociationsManyToOneTemplateClass.returning());
		}
		returningString.append("\n\t");
		if (jpaEntityAssociationsOneToManyTemplateClass.isProcessable()) {
			returningString.append(jpaEntityAssociationsOneToManyTemplateClass.returning());
		}
		returningString.append("\n\t");

		return returningString.toString();
	}
}